package com.yaoyong.codegenerator.entity;

/**
 * 数据库列实体模型
 *
 * @author 姚勇
 */
public class Column {

    /**
     * 列名称
     */
    private String name;
    /**
     * 列类型
     */
    private String type;
    /**
     * 列数据库类型
     */
    private String dbType;

    /**
     * 列备注
     */
    private String comment = "";
    /**
     * 是否是主键
     */
    private Boolean isKey;
    /**
     * 小数位数
     */
    private int decimal_digits;
    /**
     * 字段长度
     */
    private int size;

    public String getName() {
        return name;
    }

    public Column setName(String name) {
        this.name = name;
        return this;
    }

    public String getType() {
        return type;
    }

    public Column setType(String type) {
        this.type = type;
        return this;
    }

    public String getDbType() {
        return dbType;
    }

    public Column setDbType(String dbType) {
        this.dbType = dbType;
        return this;
    }

    public String getComment() {
        return comment;
    }

    public Column setComment(String comment) {
        this.comment = comment;
        return this;
    }

    public Boolean getKey() {
        return isKey;
    }

    public Column setKey(Boolean key) {
        isKey = key;
        return this;
    }

    public int getDecimal_digits() {
        return decimal_digits;
    }

    public Column setDecimal_digits(int decimal_digits) {
        this.decimal_digits = decimal_digits;
        return this;
    }

    public int getSize() {
        return size;
    }

    public Column setSize(int size) {
        this.size = size;
        return this;
    }

    @Override
    public String toString() {
        return "Column{" +
                "name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", dbType='" + dbType + '\'' +
                ", comment='" + comment + '\'' +
                ", isKey=" + isKey +
                ", decimal_digits=" + decimal_digits +
                ", size=" + size +
                '}';
    }
}
